﻿<%@ Page Language="C#" MasterPageFile="~/MMhome.Master" AutoEventWireup="true" CodeBehind="MchannelManage.aspx.cs"
    Inherits="MobileManager.MchannelManage" Title="通道管理" %>

<%@ Register Src="~/UserControl/InfoMenu.ascx" TagName="Menu" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .divLeft
        {
            width: 165px;
            list-style: none;
            margin-left: 10px;
            margin-top: 20px;
            float: left;
        }
        .divRight
        {
            float: left;
            margin-top: 10px;
            margin-right: 10px;
        }
    </style>

    <script type="text/javascript">
        function CheckSave() {
            var strNO = $("#<%=txtNO.ClientID%>").val().Trim();
            if (strNO == "") {
                alert("通道编号必须填写！");
                return false;
            }
            var strNumber = $("#<%=txtNumber.ClientID%>").val().Trim();
            if (strNumber == "") {
                alert("通道号码必须填写！");
                return false;
            }
            var strOrder = $("#<%=txtOrder.ClientID%>").val().Trim();
            if (strOrder == "") {
                alert("通道指令必须填写！");
                return false;
            }
            var strPrice = $("#<%=txtPrice.ClientID%>").val().Trim();
            if (strPrice == "") {
                alert("通道价格必须填写！");
                return false;
            }
            return true;
        }
        function CheckNum(obj) {
            var strValue = obj.value;
            if (strValue != "") {
                if (isNaN(strValue)) {
                    alert("请填写数值！");
                    obj.focus();
                }
            }
        }
        function CheckFloat(obj) {
            var strValue = obj.value;
            if (strValue != "") {
                if (isNaN(strValue)) {
                    alert("请填写数值！");
                    obj.focus();
                }
            }
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderMain" runat="server">
    <div style="width: 100%" style="text-align: center;">
        <div id="divQuery" runat="server">
            <table>
                <tr>
                    <td>
                        查询条件&nbsp;
                    </td>
                    <td style="text-align: right;">
                        通道商<span style="color: Red;">*</span>
                    </td>
                    <td style="text-align: left;">
                        <asp:DropDownList ID="ddlSP" runat="server" CssClass="dropnormal">
                        </asp:DropDownList>
                    </td>
                    <td style="text-align: right;">
                        运营商：
                    </td>
                    <td style="text-align: left">
                        <asp:DropDownList ID="ddlOP" runat="server" CssClass="dropnormal">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td style="text-align: right;">
                        通道编号<span style="color: Red;">*</span>
                    </td>
                    <td style="text-align: left;">
                        <asp:TextBox ID="txtNO" runat="server" CssClass="txtBoxNormal" MaxLength="20"></asp:TextBox>
                    </td>
                    <td style="text-align: right;">
                        通道号码<span style="color: Red;">*</span>
                    </td>
                    <td style="text-align: left;">
                        <asp:TextBox ID="txtNumber" runat="server" CssClass="txtBoxNormal" MaxLength="100"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td style="text-align: right;">
                        通道指令<span style="color: Red;">*</span>
                    </td>
                    <td style="text-align: left;">
                        <asp:TextBox ID="txtOrder" runat="server" CssClass="txtBoxNormal" MaxLength="200"></asp:TextBox>
                    </td>
                    <td style="text-align: right;">
                        通道价格(元)<span style="color: Red;">*</span>
                    </td>
                    <td style="text-align: left;">
                        <asp:TextBox ID="txtPrice" runat="server" CssClass="txtBoxNormal" MaxLength="10"
                            onblur="CheckNum(this);"></asp:TextBox>
                    </td>
                    <td colspan="2" align="center">
                    </td>
                </tr>
                <tr>
                    <td colspan="8" align="center">
                        <asp:Button ID="btnQuery" runat="server" Text="查 询" CssClass="button_green" Width="70px"
                            OnClick="btnQuery_Click" />
                        &nbsp;&nbsp;&nbsp;
                        <asp:Button ID="btnQueryAll" runat="server" Text="全部显示" CssClass="button_green" Width="70px"
                            OnClick="btnQueryAll_Click" />
                    </td>
                </tr>
            </table>
            <div style="width: 100%; text-align: left">
                <asp:Button ID="btnADDNew" runat="server" Text="添加新通道" CssClass="button_blue" Width="80px"
                    OnClick="btnADDNew_Click" /></div>
            <asp:GridView ID="GVinfo" runat="server" AutoGenerateColumns="False" CssClass="reason_box"
                Font-Size="12px" CellPadding="0" BorderWidth="0px" BorderColor="#A6E1FF" Width="100%"
                OnRowDataBound="GVinfo_RowDataBound" OnRowCancelingEdit="GVinfo_RowCancelingEdit"
                OnRowDeleting="GVinfo_RowDeleting" OnRowEditing="GVinfo_RowEditing" OnRowUpdating="GVinfo_RowUpdating"
                AllowPaging="True" OnPageIndexChanging="GVinfo_PageIndexChanging" PageSize="15">
                <Columns>
                    <asp:TemplateField HeaderText="通道编号">
                        <ItemTemplate>
                            <asp:Label ID="lbNO" runat="server" Text='<%# Bind("ChannelNO") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                        <ItemStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="通道商">
                        <ItemTemplate>
                            <asp:Label ID="lbName" runat="server" Text='<%# Bind("SPName") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                        <ItemStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="运营商">
                        <ItemTemplate>
                            <asp:Label ID="lbON" runat="server" Text='<%# Bind("ONO") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                        <ItemStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="通道号码">
                        <EditItemTemplate>
                            <asp:TextBox ID="txtNumber" runat="server" Text='<%# Bind("ChannelNumber") %>' MaxLength="20"
                                CssClass="txtInfo"></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lbNumber" runat="server" Text='<%# Bind("ChannelNumber") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                        <ItemStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="通道指令">
                        <EditItemTemplate>
                            <asp:TextBox ID="txtOrder" runat="server" Text='<%# Bind("ChannelOrder") %>' MaxLength="50"
                                CssClass="txtInfo"></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lbOrder" runat="server" Text='<%# Bind("ChannelOrder") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                        <ItemStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="限制时间">
                        <ItemTemplate>
                            <asp:Label ID="lbLimitTime" runat="server" Text='<%# Bind("LimitTime") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                        <ItemStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="单价(元)">
                        <EditItemTemplate>
                            <asp:TextBox ID="txtPrice" runat="server" Text='<%# Bind("ChannelPrice") %>' MaxLength="10"
                                CssClass="txtInfo" onblur="CheckNum(this);"></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lbPrice" runat="server" Text='<%# Bind("ChannelPrice") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                        <ItemStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="实得单价">
                        <EditItemTemplate>
                            <asp:TextBox ID="txtPriceRate" runat="server" Text='<%# Bind("ChannelPriceReal") %>'
                                MaxLength="10" CssClass="txtInfo" onblur="CheckFloat(this);"></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lbPriceRate" runat="server" Text='<%# Bind("ChannelPriceReal") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                        <ItemStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="备注">
                        <EditItemTemplate>
                            <asp:TextBox ID="txtMark" runat="server" Text='<%# Bind("Mark") %>' MaxLength="10"
                                CssClass="txtInfo" onblur="CheckFloat(this);"></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lbMark" runat="server" Text='<%# Bind("Mark") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                        <ItemStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="省份">
                        <ItemTemplate>
                            <asp:Label ID="lbPros" runat="server"></asp:Label>
                            <asp:HiddenField ID="HFPros" runat="server" Value='<%#Eval("ChannelPro") %>' />
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                        <ItemStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="管理" ItemStyle-Wrap="false">
                        <EditItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                Text="更新"></asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                Text="取消"></asp:LinkButton><asp:HiddenField ID="HF1" runat="server" Value='<%#Eval("ChannelNO") %>' />
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                Text="编辑"></asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Delete"
                                Text="删除" OnClientClick="return confirm('确定要删除？该通道对应的规则信息也会删除！')"></asp:LinkButton><asp:HiddenField
                                    ID="HF2" runat="server" Value='<%#Eval("ChannelNO") %>' />
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                        <ItemStyle BorderColor="#4DA6FF" BorderWidth="1px" Width="80px" />
                    </asp:TemplateField>
                </Columns>
                <EmptyDataTemplate>
                    <span style="color: Red; font-weight: bold;">没有数据！</span>
                </EmptyDataTemplate>
            </asp:GridView>
        </div>
        <div id="divAdd" runat="server" visible="false">
            <table border="1">
                <tr>
                    <td style="text-align: right;">
                        通道编号<span style="color: Red;">*</span>
                    </td>
                    <td style="text-align: left;">
                        <asp:TextBox ID="txtAddNO" runat="server" CssClass="txtBoxNormal" MaxLength="20"></asp:TextBox>
                    </td>
                    <td style="text-align: right;">
                        通道商<span style="color: Red;">*</span>
                    </td>
                    <td style="text-align: left;">
                        <asp:DropDownList ID="ddlSPbusi" runat="server" CssClass="dropnormal">
                        </asp:DropDownList>
                    </td>
                    <td style="text-align: right;">
                        运营商<span style="color: Red;">*</span>
                    </td>
                    <td style="text-align: left;">
                        <asp:DropDownList ID="ddlODEP" runat="server" CssClass="dropnormal">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td style="text-align: right;">
                        通道号码<span style="color: Red;">*</span>
                    </td>
                    <td style="text-align: left;">
                        <asp:TextBox ID="txtAddNumber" runat="server" CssClass="txtBoxNormal" MaxLength="100"></asp:TextBox>
                    </td>
                    <td style="text-align: right;">
                        通道指令<span style="color: Red;">*</span>
                    </td>
                    <td style="text-align: left;">
                        <asp:TextBox ID="txtAddOrder" runat="server" CssClass="txtBoxNormal" MaxLength="200"></asp:TextBox>
                    </td>
                    <td style="text-align: right;">
                        时间限制<span style="color: Red;">*</span>
                    </td>
                    <td style="text-align: left;">
                        <asp:DropDownList ID="ddlLimitTime" runat="server" CssClass="dropnormal">
                            <asp:ListItem Value="0" Text="无限制"></asp:ListItem>
                            <asp:ListItem Value="7" Text="0-7"></asp:ListItem>
                            <asp:ListItem Value="8" Text="0-8"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td style="text-align: right;">
                        通道价格(元)<span style="color: Red;">*</span>
                    </td>
                    <td style="text-align: left;">
                        <asp:TextBox ID="txtAddPirce" runat="server" CssClass="txtBoxNormal" MaxLength="10"
                            onblur="CheckNum(this);"></asp:TextBox>
                    </td>
                    <td style="text-align: right;">
                        实得单价(元)<span style="color: Red;">*</span>
                    </td>
                    <td style="text-align: left;">
                        <asp:TextBox ID="txtAddPirceRate" runat="server" CssClass="txtBoxNormal" MaxLength="10"
                            onblur="CheckFloat(this);"></asp:TextBox>
                    </td>
                    <td style="text-align: right;">
                        备注
                    </td>
                    <td style="text-align: left;">
                        <asp:TextBox ID="txtMark" runat="server" CssClass="txtBoxNormal"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td style="text-align: right;">
                        选择省份：
                    </td>
                    <td style="text-align: left;" colspan="5">
                        <div style="overflow-y: scroll; width: 100%; height: 200px">
                            <asp:CheckBoxList ID="cblProvince" runat="server">
                            </asp:CheckBoxList>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td style="text-align: right;">
                        选择屏蔽中文关键字：
                    </td>
                    <td style="text-align: left;" colspan="5">
                        <div style="overflow-y: scroll; width: 100%; height: 200px">
                            <asp:CheckBoxList ID="cblChinase" runat="server">
                            </asp:CheckBoxList>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td style="text-align: right;">
                        选择屏蔽英文关键字：
                    </td>
                    <td style="text-align: left;" colspan="5">
                        <div style="overflow-y: scroll; width: 100%; height: 200px">
                            <asp:CheckBoxList ID="cblEnglish" runat="server">
                            </asp:CheckBoxList>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td style="text-align: right;">
                        选择屏蔽号码关键字：
                    </td>
                    <td style="text-align: left;" colspan="5">
                        <div style="overflow-y: scroll; width: 100%; height: 200px">
                            <asp:CheckBoxList ID="cblNumber" runat="server">
                            </asp:CheckBoxList>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="6" align="center">
                        <asp:Button ID="btnADD" runat="server" Text="保 存" CssClass="button_blue" Width="80px"
                            OnClick="btnADD_Click" OnClientClick="return CheckSave();" />&nbsp;&nbsp;
                        <asp:Button ID="btnBack" runat="server" Text="返 回" CssClass="button_blue" Width="70px"
                            OnClick="btnBack_Click" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
</asp:Content>
